/**
 * Created by user on 2018/7/4.
 */
import React, { Component } from 'react'
import { connect } from 'react-redux'
import GlobalTitle from '@com/globalTitle'
import LiveScreen from '@com/replay/live'
import QaScreen from '@com/replay/qa'
import NoAudio from '@com/replay/NoAudio'

class ReplayScreen extends Component {
  renderContent() {
    const { noAudio } = this.props
    return noAudio.show ? (
      <div className="replay_container">
        <NoAudio />
      </div>
    ) : (
      <div className="replay_container">
        <LiveScreen />
        <QaScreen />
      </div>
    )
  }
  render() {
    return(
      <div>
        <GlobalTitle />
        { this.renderContent() }
      </div>
    )
  }
}
const mapStateToProps = (state) => {
  return {
    noAudio: state.ReplayState.noAudio
  }
}
export default connect(mapStateToProps)(ReplayScreen)
